package cn.tedu.luban.demand.main.rpc;

import cn.tedu.luban.demand.api.DemandApi;
import cn.tedu.luban.demand.main.service.RequestOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class DemandApiImpl implements DemandApi {
    @Autowired
    private RequestOrderService requestOrderService;
    /**
     * @param requestOrderNo
     * @return
     */
    @Override public Boolean grabOrder(String requestOrderNo) {
        Boolean grab=false;
        try{
            grab=requestOrderService.grabOrder(requestOrderNo);
        }catch (Throwable e){
            log.error("抢单失败:{}",requestOrderNo,e);
        }
        return grab;
    }

    @Override public Boolean returnOrder(String requestOrderNo) {
        return null;
    }
}
